<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
			<title>startDefaultService()</title>
			<link href="styles.css" rel="stylesheet" type="text/css">
			<link href="styles_class.css" rel="stylesheet" type="text/css">
	</head>

	<body>
		<div id="container">
			<div id="header"><span>
				<p><a href="http://mjs.darkgreenmedia.com">mjs.darkgreenmedia.com</a></p>
				<p><a href="MBluetooth.html">back</a></p>
				</span>
			</div>

		<div class="block1">
			<div class="title"><h2>Name</h2></div>
			<div class="block2"><p class="name">startDefaultService</p></div>
		</div>

		<div class="block1">
			<div class="title"><h2>Examples</h2></div>
			<div class="block2">
				<div class="sample">
					<pre>
import mjs.processing.mobile.mbluetooth.*;
import mjs.processing.mobile.mclientserver.*;

int action;

boolean serverRunning;

MServer server;

void draw()
{
	if(action == 1 && !serverRunning)
	{
		startServer()
		serverRunning = true;
	}
}

void startServer()
{
	server = MBluetooth.startDefaultService();
}

void keyPressed()
{
	if(key == '*')
		action = 1;
		
	if(server != null)
		server.writeChar(key);
}
					</pre>
    				<br/>
	  			</div>
			</div>
		</div>
	
		<div class="block1">
			<div class="title"><h2>Description</h2></div>
			<div class="block2">Start the default Mobile Processing Service.<br/>
			<br/>
			See the ClientSever documentation for more information about data exchange</div>
		</div>


		<div class="block1">
			<div class="title"><h2>Syntax</h2></div>
			<div class="block2">
				<ul>
  					<li>MBluetooth.startDefaultService()</li>
 				</ul>
			</div>

		</div>

		<div class="block1">
			<div class="title"><h2>Returns</h2></div>
			<div class="block2">
			<ul>
 				<li>MServer</li>
	 			<div class="description2">A server ready to accept clients and send data</div>
			</ul>
		</div>
		
	</div>
</body>
</html>
